# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-net-write
_pkgname=Net-Write
pkgver=1.10
pkgrel=14
pkgdesc='A portable interface to open and send raw data to network.'
arch=('any')
url='https://metacpan.org/release/Net-Write'
license=('GPL' 'PerlArtistic')
depends=('perl-class-gomor' 'perl-socket6' 'perl-net-pcap>=0.12')
options=('!emptydirs')
source=("http://search.cpan.org/CPAN/authors/id/G/GO/GOMOR/$_pkgname-$pkgver.tar.gz")
sha512sums=('d0e665b277ee6c6857b1cfad0dc6fd3227d54d5df4be131ad586e853d46c81e5e93aa0e515cdde7cc9fcc7d08feb46bc58c81c1028fcc138d312c6708cc47df2')

prepare() {
  cd "$_pkgname-$pkgver"

  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
  cd "$_pkgname-$pkgver"

  make
}

package() {
  cd "$_pkgname-$pkgver"

  make DESTDIR="$pkgdir" install

  find "$pkgdir" -name '.packlist' -o -name '*.pod' -delete
}

